/*
*  An example application that shows the usage of the object matrixsum
*  Copyright (c) 2008, <Kristof Bal>, the New BSD License
*/
#include <stdio.h>
#include "matrixfunctions.h"

main(){
  matrix m1
  int rowcounter=0;
  int columncounter=0;

  printf("Enter the number of rows and columns the matrix should have:");
  scanf("%d %d", &m1.i, &m1.j);
  //Start row by row, beginning with "0" (or 1, but an array starts with 0
  while (rowcounter<row){
    //The real work is done in the row, column by column
    while (columncounter<column){
      scanf("%lf", &m.values[rowcounter][columncounter]);
      columncounter++;      //switch to next column
    }
    columncounter=0;   //prepare for next row...
    rowcounter++;      //...and switch to it
  }
  printf("\n");
  //Now, caculate the sum of the matrix with itself
  matrix print;
  print=matrixsum(m1, m1);
  printf("%f", print.values[0][0]);
}
